'use strict';
var calculate_average = function(collection){
   var arr=[];
   var a;
   for(let i=0;i<collection.length;i++){
       if(i%2!=0){
           arr.push(collection[i])
       }
   }
   var ab=arr.reduce( function (total,item){
    return total + item;}
    ,0);
    a=ab/arr.length;
    console.log(a);
   return a; 
};
module.exports = calculate_average;
